﻿// Services/DatabaseService.cs

using System.Collections.Generic;
using DatabaseManager.DataProviders;
using DatabaseManager.Infrastructure.Connections;
using DatabaseManager.Core.Models;

namespace DatabaseManager.Services
{
    public class DatabaseService : IDatabaseService
    {
        private readonly IDataProvider _dataProvider;

        public DatabaseService(IDataProvider dataProvider)
        {
            _dataProvider = dataProvider;
        }

        public bool TestConnection()
        {
            return _dataProvider.TestConnection();
        }

        public List<TableInfo> GetTables()
        {
            return _dataProvider.GetTables();
        }

        public List<ColumnInfo> GetColumns(string tableName)
        {
            return _dataProvider.GetColumns(tableName);
        }

        public List<string> GetDatabases()
        {
            return _dataProvider.GetDatabases();
        }
    }
}